//
//  NGAppDelegate.h
//  NetMobileLocation
//
//  Created by Mehmet Sinan Şahin on 1/8/12.
//  Copyright (c) 2012 netgis. All rights reserved.
//

//
//  NGAppDelegate.h
//  Mobil Izleme
//
//  Created by Mehmet Sinan Şahin on 1/2/12.
//  Copyright (c) 2012 netgis. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FTLocationSimulator.h"
#import "ServiceAgreementViewController.h"

#define USE_THIS_LOCATION_MANAGER FALSE

static void _set_globals(void);

//@class NGViewController;
@class TabbarController;
@class Reachability;
@class NGLocation;

@interface NGAppDelegate : UIResponder <UIApplicationDelegate, CLLocationManagerDelegate, UITabBarControllerDelegate, ServiceAgreementWindowClose> {
    
    BOOL flagNoConnectionAlertShown;
    Reachability* internetReach;
#if USE_THIS_LOCATION_MANAGER
#ifdef FAKE_CORE_LOCATION
    FTLocationSimulator *locationManager;
#else
    CLLocationManager *locationManager;
#endif
#endif
}
@property (strong, nonatomic) UIWindow *window;

#if USE_THIS_LOCATION_MANAGER
#ifdef FAKE_CORE_LOCATION
@property (nonatomic, retain) FTLocationSimulator *locationManager;
#else
@property (nonatomic, retain) CLLocationManager *locationManager;
#endif
#endif

//@property (strong, nonatomic) NGViewController *viewController;
@property (strong, nonatomic) UITabBarController *tabBarController;
@property (strong, nonatomic) id mainViewController;
@property (nonatomic, assign) BOOL flagNoConnectionAlertShown;


- (void)startUpdates: (NSString *)mode;
- (void)sendLocationToServer:(CLLocation *)location;

#pragma mark - internet connection reachability
- (void)sendUnsentLocationToServer:(BOOL)lookforReachability;

- (void)networkConnectionReachabilityInitialize;

#pragma mark - ui operations
- (void)makeTabBarHidden:(BOOL)hide;

/*
 * If login success, enter is called, adds tabControl
 */
- (void)enter;

/*
 * While terminating sends application terminated message to server
 */
- (void)sendAppTerminated;
- (void)sendAppStarted:(id) targetForUI;

- (void)installUncaughtExceptionHandler;

+ (NGAppDelegate *) getApp;

+ (void) alertForNoInternetConnection;

- (void) setMessageBadge:(int)numberOfMessage;


@end
